I need to glue/adhesive a printed photo to a glass, and I need the glue to be completely transparent since the photo will be watched through the glass.
Most adhesives will yellow with age and sun exposure, but the glass provides better protection for the actual image compared to putting it on the viewer side. One method that has a good history is a decoupage liquid, available in craft stores. Look for a kind marked "dries clear, stays clear" or similar; some cloud a bit, others can yellow or cloud with time. Generally, the best are the urethane based versions.
You might also check at home improvement or hardware stores for urethane varnish products; these are essentially the same material, only packaged for application to bare wood. General application method is to apply a thin, even layer to the glass, wait a bit for the brush marks to self-level, then apply the picture like a decal (curve it a bit, set the center down, then work gradually outward with a plastic paddle or spatula to seat the entire item into the coating and push bubbles out). Once the entire item is adhered, follow package direction for recoating to apply at least one additional coat over the item.
You may also need to apply an opaque sheet behind the photo to prevent backlight from showing text from the back of the photo through the image -- this will be worse after application, because the coating will usually make the paper more transparent than it was.
Anything applied to glass has a tendency to peel; there's no real way around this if the glass is polished (as window glass and similar are). If the glass is frosted, the coating will adhere better, but it'll be nearly impossible to fill in the frosting texture completely enough to restore transparency, due to the viscosity of the coating.
A very similar technique can be used for displaying your photos on glass. You need a toner-based print of your photo (e.g. using a copier or laser printer) and some clear contact paper.
Sticking the contact paper to your print will transfer the toner from your ordinary paper to the sticky transparent film. The next step is to soak the two connected sheets in water, which softens up the white paper and allows it to be rubbed off. What you’re left with is a piece of wet transparent contact paper that features your photo. Let it dry to restore its stickiness, and then attach the resulting “sticker” to whatever you’d like to show off your photo on (e.g. glass jars, candle holders, windows etc.)
Spray mount adhesive may do the job. I would recommend trying it with something other than the photo you want to mount first. If it doesn't work satisfactorily, the glass should be easy enough to clean afterwards.
DO NOT DO THIS. It will probably destroy your print and not give you the effect you wish.
You can make it LOOK like it is glued to the back of the glass in the frame.
Get two sheets of glass the same size and press the print between them. Then frame the print with no cardboard behind it.
With a space around the print, it looks as if the print was glued to the back of the glass and suspended within the print frame.