update photo attachment logic