Just add the document ready function, this way it waits until the DOM has been loaded, also by using the :visible
pseudo you can write a simple show and hide function.
$(document).ready(function(){
$( '.expand' ).click(function() {
if($( '.img_display_content' ).is(":visible")){
$( '.img_display_content' ).hide();
} else{
$( '.img_display_content' ).show();
}
});
});