My phone is Samsung Galaxy Grand. If I delete a photo from the gallery and make a backup before flashing, will I get that photo in the backup?
That very much depends on the type of backup you are talking about. As the photo was deleted, none of the usual backup approaches would cover it: a backup only takes what is there, not was was deleted.
How to recover that photo (if possible) depends not at last on where it was stored:
- external SDCard: safely remove it from the device, and use a card reader to check for deleted files with your computer and an application like PhotoRec
- internal SDCard: not that easy. You have to clone that partition (a nandroid backup usually does this), transfer it to your computer, and analyse it with an application like TestDisk or Scalpel
Details and further hints can be found e.g. in our data-recovery tag-wiki. See e.g.:
Usually, flashing of the ROMs only affects files that are stored on your /system partition. Photos are stored on a SD card, and won't be deleted when you flash a ROM.
As for deleted photo, once it's deleted it can't be restored by normal methods. You could try restoring deleted files (there are many articles on the Internet regarding that, try searching for "restore deleted photos on android")