query.setFilter("photoEntryId == photoEntryIdParam && index == indexParam");
query.declareParameters("String photoEntryIdParam, int indexParam");
List<DataChunk> results = (List<DataChunk>) query.execute(photoEntryId, index);
if (results.size() > 0) {
DataChunk dataChunk = results.get(0);
bytes = dataChunk.getData();
int startIndex = (int) startByte - (index * DataChunk.CHUNK_SIZE);
if (startIndex != 0) {
bytes = Arrays.copyOfRange(bytes, startIndex, bytes.length);
}