Update functionality.js

Fixed bug on img showing