Fixing bug that returns same picture multiple times