Fixed bug in photo functionality