Can you associate the pictures with some type of string?
Such as the filename or something of that sort?
That way you can look it up in a hashmap which will give you as close as O(1) time as you're going to get.
There is also included a way to get the entrySet from the hashmap if you need to go through each of them.
This is included in the API:
HashMap
Basically I think you need to look into ways to optimizing the whole thing. It may be worth wild to do a search on Google about optimizing java code. Besides that without looking at the code I can't tell you much else about it.
Greetings.