If the default image is in some other table you can join that table into your query and for example with coalesce function select the default when necessary. For example something like:
select coalesce (a.simage, b.defaultimagefield)
from tbstudent a, tablewithdefaultimage b ...